home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / July 96 / FW_PResource GetResourceHandle < prev    next >
Encoding:
Internet Message Format  |  1996-07-30  |  1.0 KB  |  [TEXT/ttxt]

  1. Subject:     FW_PResource::GetResourceHandle()
  2. Sent:        7/19/96 8:07 AM
  3. Received:    7/19/96 3:22 PM
  4. From:        Keith Mortensen, morty@scruznet.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. I am using the following code to load a custom resource from my running part.
  9. The returned data is not correct.
  10.  
  11. Am I using GetResourceHandle() incorrectly?
  12. Will AcquireData() method be sufficient? or is that only for ODF-supported resource types?
  13.  
  14.  
  15. typedef struct
  16. {
  17.     unsigned short    count;
  18.     Rect            r[1];
  19. }    nrctResource;
  20. typedef    nrctResource    **nrctHandle;
  21.  
  22. void CMainFrame::GetRect(Environment* ev, ODSShort whichRect)
  23. {
  24.     Rect finalRect;
  25.     FW_CSharedLibraryResourceFile resFile(ev);
  26.     FW_PResource myResource(ev,resFile,1000,'nrct');
  27.     nrctHandle tempH = (nrctHandle)myResource->GetResourceHandle(ev);
  28.     finalRect = (*tempH)->r[whichRect];
  29.     // use the rect data from 'finalRect'...  <--•• finalRect does not have the right data!
  30.     myResource->ReleaseData(ev);
  31. }
  32.